package com.icode.core.model.house;

import com.icode.core.model.AbstractEntity;

import javax.persistence.*;

/**
 * Created with IntelliJ IDEA.
 * User: xianfei
 * Date: 15-11-12
 * Time: 下午3:02
 * To change this template use File | Settings | File Templates.
 */
@Entity
@Table(name = "agreement")
public class Agreement extends AbstractEntity {

    @OneToOne
    @JoinColumn(name = "house_info_id")
    private HouseInfo houseInfo;
    private String content;
    @ManyToOne
    @JoinColumn(name = "id_card")
    private UploadImage idCard;
    @ManyToOne
    @JoinColumn(name = "customer_sign")
    private UploadImage customerSign;

    public Agreement() {
    }

    public Agreement(HouseInfo houseInfo, String content) {
        this.houseInfo = houseInfo;
        this.content = content;
    }

    public Agreement(HouseInfo houseInfo, String content, UploadImage idCard, UploadImage customerSign) {
        this.houseInfo = houseInfo;
        this.content = content;
        this.idCard = idCard;
        this.customerSign = customerSign;
    }

    public void initAgreementIdCard(UploadImage idCard) {
        this.idCard = idCard;

    }

    public void initAgreementSign(UploadImage customerSign) {
        this.customerSign = customerSign;
    }

    public HouseInfo houseInfo() {
        return houseInfo;
    }

    public String content() {
        return content;
    }

    public UploadImage idCard() {
        return idCard;
    }

    public UploadImage customerSign() {
        return customerSign;
    }
}
